# with open(__file__, "r", encoding="utf-8") as fr:
#     lines = fr.readlines()
#     write_lines = []
#     with open("/tmp/foo.txt", "w", encoding="utf-8") as fw:
#         for i in range(len(lines)):
#             data = "#{} {}".format(i + 1, lines[i])
#             write_lines.append(data)
#         fw.writelines(write_lines)

with open(__file__, "r", encoding="utf-8") as fr:
    lines = fr.readlines()
    write_lines = [
        "#{} {}".format(n + 1, line) for n, line in zip(range(len(lines)), lines)
    ]
with open("/tmp/foo.txt", "w", encoding="utf-8") as fw:
    fw.writelines(write_lines)
